Special case 'whitespace' in badchars. (Allows "w" in gpsdrive.)
authorrobertl <robertl>
Fri, 6 Oct 2006 14:45:13 +0000 (14:45 +0000)
committerrobertl <robertl>
Fri, 6 Oct 2006 14:45:13 +0000 (14:45 +0000)
xcsv.c

diff --git a/xcsv.c b/xcsv.c
index 32837cd8b0077fc922cd0c31919ea0b268ad6e4f..b6a9d0220eee677d1c4400d184a321fd3b330d2c 100644 (file)
--- a/xcsv.c
+++ b/xcsv.c
@@ -218,15 +218,11 @@ xcsv_parse_style_line(const char *sbuff)
                p = csv_stringtrim(xcsv_file.field_delimiter, " ", 0);
 
                /* field delimiters are always bad characters */
-               if (xcsv_file.badchars) {
-                       xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
-                               strlen(xcsv_file.badchars) +
-                               strlen(p) + 1);
+               if (0 == strcmp(p, "\\w")) {
+                       xstrappend(xcsv_file.badchars, " \n\r");
                } else {
-                       xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
+                       xcsv_file.badchars = xstrappend(xcsv_file.badchars, p);
                }
-
-               strcat(xcsv_file.badchars, p);
                
                xfree(p);